河狸影视[V2].js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. var rule = {
  2. title: '河狸影视[V2]', // csp_AppYsV2
  3. host: 'https://www.heli888.cc/api.php/app/',
  4. url: 'video?tid=fyclassfyfilter&limit=20&pg=fypage',
  5. filter_url: '&class={{fl.class}}&area={{fl.area}}&lang={{fl.lang}}&letter={{fl.letter}}&year={{fl.year}}&by={{fl.by}}',
  6. filter: 'H4sIAAAAAAAAA+2Y3W4aRxTH34VrX+wS56N5lSoXqEK9iOuLRK0URZZsYwgQx2DLwaHgr8YY4hoMtuPCUuBldnaXt+iwZ84HUb1atVauuON3zp7ZOWeY85/Ztwk78fzHt4mX6TeJ54mfVlKvXyeWEqupX9IaVaHpZbKaf0ut/JoOn1udmbOtaaY1M2tIrC0Za6WunzdWA+jz8z0zEAP6vI2yt14xPgM0ZrHljuo4JgCN2dxVgyGOCUBxNHEGel/+k+sU8H0A6Ava52r7wvgM0PuKV/4IfQbEPP39Ic9zBuRrvON5GqC5tM/d8QnOBYDicnvT6heMA6C4ows9c4wDiFNPb/PSr+yiD4B8maK3+Tv6ACj3YUll+5g7APqmh3vep4bxGaAxK++CgoNjAlB+446//1WNepgiMT1ROgs+0yoCkG8np0rX6AOgVZyU9RrgKgJwVeve4S5VNQTybU38PzETA1SB0a4/rM9NeM609mL2JOyi1Kt0SmyieldtO3E30VlzWs3hFACo0OdVr3+FhQbgUnW9wZhKFQJNfbyjaiOcNAAt0M1H9hmgMr7vsc8AxR00vPolxgHQPI+/cJwBXvS/2GeA59KVc+nOxX3oKucc4wAobqukK6XyuFeYKZPGxC+1/UIVkyHmDXzivZ/oMNrDyPRE9s4d4rYyIBd9JbX6My96cNUOWutxF7020s/j0ABiEdhngBb2+ox9BmgRDkbqwwG7mcUyCTeAWF72GRB/GeEDEMsrMgEQBVSdDBdwBrKAb9KpV2LXDG7d4ShmAZNW8pGxhT+FPcn2pLTbbLel3WK7Jez2D2TXP4X9GdufSftTtj+V9idsfyLtj9n+WNqX2b4s7ZyvLfO1OV9b5mtzvrbM1+Z8bZmvxflaMl+L87VkvhbnZcm8LM7LknlZnJf+qf8GL5YSyYc6iETIRpT4g3apjTuVKc3JmTHFOeiozp1yaAMAxDxA3HvQiTpARB10oiQyStDdwSlLpAE+JGS9KmqQAXrfxxwfSgwI+eSaGYjbWf+PnOay+nlS+xDiyNR/ldooWYyW4fulL1KGK12tVOrwlI5YyAvZ+ka2FvKzkJ9I+Xn0QPIzXS/4zXX8gwLI9rl1LNqnBtoynUnQzeOWAaC4vbZXxJuJAf7TZ71+n/70IfBmuXEHZdosIYh+NP2MczFAPudCdY7QB0Dvq12LOx0Axe0fe7d0JweguH7fy5dcZ4/vZnMmqsPtH1qQsA4ANEZvM9jYxmiA7yAVuv3rRk+TDkH0HN2FuOfMgHyXTV1Y9AEsmu+i+S6a77fNd/mBmm9Ug436YOhn2sEpNm0DNOZOyy/jNxkD5Csf+Zf0QQ2AO8r9H/CC8mGwg/cQAzTmyamq0UYCiHNP8OqO+CgIQO+L+CQWdSdSXV2mW3wfgPQ1boRPA9XzbOz+jR8TDfC95Fjla3QvCYHuHs61aqNgGaAxa0WvisJjgOvSU5MDqksI3+N+URu5Dl0FAeLcBf5VGBYn9oVoLEQjtmis/QN1egR0uxoAAA==',
  7. detailUrl: '/detail?vod_id=fyid',
  8. searchUrl: '/search?text=**&pg=fypage',
  9. searchable: 2,
  10. quickSearch: 0,
  11. filterable: 1,//是否启用分类筛选,
  12. headers: {'User-Agent': 'okhttp/4.1.0'},
  13. timeout: 5000,
  14. // 分类筛选 /api.php/app/nav || /xgapp.php/v1/nav || /api.php/v1.vod/types
  15. class_name: '电影&电视剧&综艺&动漫',
  16. class_url: '1&2&3&4',
  17. play_parse: true,
  18. // lazy:'js:input="https://jx.xmflv.com/?url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input',
  19. lazy: `js:
  20. let play_Url = '';
  21. if (/\\.m3u8|\\.mp4/.test(input)) {
  22. input = {
  23. jx: 0,
  24. url: input,
  25. parse: 0
  26. }
  27. } else if (/,/.test(input) && /url=/.test(input)) {
  28. input = input.split('url=');
  29. play_Url = input[0].split(',')[0];
  30. input = {
  31. jx: 0,
  32. url: input[1],
  33. playUrl: play_Url,
  34. parse: 1
  35. }
  36. } else if (/url=|id=/.test(input)) {
  37. input = {
  38. jx: 0,
  39. url: JSON.parse(request(input)).url,
  40. parse: 0
  41. }
  42. } else if (/youku|iqiyi|v\\.qq\\.com|pptv|sohu|le\\.com|1905\\.com|mgtv|bilibili|ixigua/.test(input)) {
  43. play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'https://jx.xmflv.com/?url='; // type0的parse
  44. // play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'json:http://pandown.pro/app/kkdy.php?url='; // type1的parse可加'json:'直接解析url (除了蜂蜜的'影视TV',其它的壳皆可用)
  45. input = {
  46. jx: 0,
  47. url: input,
  48. playUrl: play_Url,
  49. parse: 1,
  50. header: JSON.stringify({
  51. 'user-agent': 'Mozilla/5.0',
  52. }),
  53. }
  54. } else {
  55. input
  56. }
  57. `,
  58. limit: 6,
  59. // 图片来源:'@Referer=https://api.douban.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36',
  60. 推荐: `js:
  61. let d = [];
  62. let jsondata = [];
  63. let videoList = [];
  64. if (/v1\\.vod/.test(HOST)) {
  65. if(HOST.endsWith('/')){
  66. jsondata = JSON.parse(request(HOST + 'vodPhbAll'));
  67. } else {
  68. jsondata = JSON.parse(request(HOST + '/vodPhbAll'));
  69. }
  70. videoList = jsondata.data.list;
  71. } else {
  72. if(HOST.endsWith('/')){
  73. jsondata = JSON.parse(request(HOST + 'index_video'));
  74. } else {
  75. jsondata = JSON.parse(request(HOST + '/index_video'));
  76. }
  77. videoList = /xgapp/.test(HOST) ? jsondata.data : jsondata.list;
  78. }
  79. // log('videoList =========> '+stringify(videoList));
  80. videoList.forEach((it,idex) => {
  81. let vlist = /v1\\.vod/.test(HOST) ? videoList[idex].vod_list : videoList[idex].vlist ;
  82. vlist.forEach(it => {
  83. d.push({
  84. url:it.vod_id,
  85. title:it.vod_name,
  86. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  87. desc:it.vod_remarks,
  88. });
  89. });
  90. });
  91. setResult(d);
  92. `,
  93. 一级: `js:
  94. let d = [];
  95. let jsondata = [];
  96. let videoList = [];
  97. if (/v1\\.vod/.test(HOST)) {
  98. input = input.replace('video','v1.vod').replace('tid','type').replace('pg=','page=');
  99. jsondata = JSON.parse(request(input));
  100. videoList = jsondata.data.list;
  101. } else {
  102. input = HOST + '/'+ input.split('/')[4];
  103. jsondata = JSON.parse(request(input));
  104. videoList = jsondata.list || jsondata.data;
  105. }
  106. // log('videoList =========> '+stringify(videoList));
  107. videoList.forEach(it => {
  108. d.push({
  109. url:it.vod_id,
  110. title:it.vod_name,
  111. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  112. desc:it.vod_remarks,
  113. });
  114. });
  115. setResult(d);
  116. `,
  117. 二级: `js:
  118. if (/v1\\.vod/.test(HOST)) {
  119. input = HOST + '/'+ input.split('/')[3];
  120. } else {
  121. input = HOST + '/'+ input.split('/')[3].replace('detail','video_detail').replace('vod_id','id');
  122. }
  123. try {
  124. let html = request(input);
  125. html = JSON.parse(html);
  126. let node = /xgapp/.test(HOST) ? html.data.vod_info : html.data;
  127. VOD = {
  128. vod_id: node.vod_id,
  129. vod_name: node.vod_name,
  130. vod_pic: node.vod_pic,
  131. type_name: node.vod_class,
  132. vod_year: node.vod_year,
  133. vod_area: node.vod_area,
  134. vod_remarks: node.vod_remarks,
  135. vod_actor: node.vod_actor,
  136. vod_director: node.vod_director,
  137. vod_content: node.vod_content.strip()
  138. };
  139. if (typeof play_url === 'undefined') {
  140. var play_url = ''
  141. }
  142. var name = {
  143. 'bfzym3u8': '暴风',
  144. '1080zyk': '优质',
  145. 'kuaikan': '快看',
  146. 'lzm3u8': '量子',
  147. 'ffm3u8': '非凡',
  148. 'haiwaikan': '海外看',
  149. 'gsm3u8': '光速',
  150. 'zuidam3u8': '最大',
  151. 'bjm3u8': '八戒',
  152. 'snm3u8': '索尼',
  153. 'wolong': '卧龙',
  154. 'xlm3u8': '新浪',
  155. 'yhm3u8': '樱花',
  156. 'tkm3u8': '天空',
  157. 'jsm3u8': '极速',
  158. 'wjm3u8': '无尽',
  159. 'sdm3u8': '闪电',
  160. 'kcm3u8': '快车',
  161. 'jinyingm3u8': '金鹰',
  162. 'fsm3u8': '飞速',
  163. 'tpm3u8': '淘片',
  164. 'lem3u8': '鱼乐',
  165. 'dbm3u8': '百度',
  166. 'tomm3u8': '番茄',
  167. 'ukm3u8': 'U酷',
  168. 'ikm3u8': '爱坤',
  169. 'hnzym3u8': '红牛资源',
  170. 'hnm3u8': '红牛',
  171. '68zy_m3u8': '68',
  172. 'kdm3u8': '酷点',
  173. 'bdxm3u8': '北斗星',
  174. 'qhm3u8': '奇虎',
  175. 'hhm3u8': '豪华',
  176. 'kbm3u8': '快播'
  177. };
  178. let episodes = /v1\\.vod/.test(HOST)?node.vod_play_list:node.vod_url_with_player;
  179. if (episodes != '') {
  180. let playMap = {};
  181. let arr = [];
  182. episodes.forEach(ep => {
  183. let from = [];
  184. if (/v1\\.vod/.test(HOST)) {
  185. from = ep.player_info.from||ep.player_info.show||ep.from||ep.show;
  186. } else {
  187. from = ep.code||ep.name;
  188. }
  189. if (!playMap.hasOwnProperty(from)) {
  190. playMap[from] = []
  191. }
  192. // let parse_api = '';
  193. // if (/v1\\.vod/.test(HOST)) {
  194. // parse_api = ep.player_info.parse != null ? ep.player_info.parse : ep.player_info.parse2;
  195. // // parse_api = /,/.test(parse_api) ? parse_api.split(',')[1] : parse_api;
  196. // } else {
  197. // parse_api = ep.parse_api;
  198. // }
  199. // log('parse_api =========> '+parse_api);
  200. // if (parse_api != null && !/\\.m3u8|\\.mp4/.test(ep.url)) {
  201. // parse_api = parse_api.replaceAll('..','.') ;
  202. // ep.url = ep.url.replaceAll('$','$'+parse_api);
  203. // }
  204. if (from != null) playMap[from].push(ep.url)
  205. });
  206. for (var key in playMap) {
  207. if ('bfzym3u8' == key) {
  208. arr.push({
  209. flag: name[key],
  210. url: playMap[key],
  211. sort: 1
  212. })
  213. } else if ('1080zyk' == key) {
  214. arr.push({
  215. flag: name[key],
  216. url: playMap[key],
  217. sort: 2
  218. })
  219. } else if ('kuaikan' == key) {
  220. arr.push({
  221. flag: name[key],
  222. url: playMap[key],
  223. sort: 3
  224. })
  225. } else if ('lzm3u8' == key) {
  226. arr.push({
  227. flag: name[key],
  228. url: playMap[key],
  229. sort: 4
  230. })
  231. } else if ('ffm3u8' == key) {
  232. arr.push({
  233. flag: name[key],
  234. url: playMap[key],
  235. sort: 5
  236. })
  237. } else if ('snm3u8' == key) {
  238. arr.push({
  239. flag: name[key],
  240. url: playMap[key],
  241. sort: 6
  242. })
  243. } else if ('qhm3u8' == key) {
  244. arr.push({
  245. flag: name[key],
  246. url: playMap[key],
  247. sort: 7
  248. })
  249. } else {
  250. arr.push({
  251. flag: name[key] ? name[key] : key,
  252. url: playMap[key],
  253. sort: 8
  254. })
  255. }
  256. }
  257. arr.sort((a, b) => a.sort - b.sort);
  258. let playFrom = [];
  259. let playList = [];
  260. arr.map(val => {
  261. if (!/undefined/.test(val.flag)) {
  262. playFrom.push(val.flag);
  263. playList.push(val.url);
  264. }
  265. })
  266. VOD.vod_play_from = playFrom.join('$$$');
  267. VOD.vod_play_url = playList.join('$$$');
  268. } else {
  269. VOD.vod_play_from = node.vod_play_from;
  270. VOD.vod_play_url = node.vod_play_url;
  271. }
  272. } catch (e) {
  273. log("获取二级详情页发生错误:" + e.message);
  274. }
  275. `,
  276. 搜索: `js:
  277. let d = [];
  278. let jsondata = [];
  279. let videoList = [];
  280. if (/v1\\.vod/.test(HOST)) {
  281. input = (HOST + '/'+ input.split('/')[3]).replace('/search','').replace('text=','wd=').replace('pg=','page=');
  282. jsondata = JSON.parse(request(input));
  283. videoList = jsondata.data.list;
  284. } else {
  285. input = HOST + '/'+ input.split('/')[3]
  286. jsondata = JSON.parse(request(input));
  287. videoList = jsondata.list || jsondata.data;
  288. }
  289. // log('videoList =========> '+stringify(videoList));
  290. videoList.forEach(it => {
  291. d.push({
  292. url:it.vod_id,
  293. title:it.vod_name,
  294. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  295. desc:it.vod_remarks,
  296. });
  297. });
  298. setResult(d);
  299. `,
  300. }